using System.IO;
using System.Reflection;
using System.Web;

namespace Patriq.Common.Environment
{
    public class ExecutionEnvironment : IEnvironment
    {
        public string BasePath
        {
            get
            {
                if (HttpContext.Current != null)
                    return HttpContext.Current.Server.MapPath("~");

                return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            }
        }
    }
}